import {PureComponent} from "react";
import { CloseOutlined, PlusOutlined,EditOutlined } from '@ant-design/icons';
import React from 'react'

/**
 * 资源单元
 */
class ResourceItem extends PureComponent {
  render() {
  const {title, item,onDelete, onUpdate, onCreate} = this.props;
    return <div style={{ display: 'flex', alignItems: 'center' }}>
      <span>{title}</span>
      <span style={{ display: 'flex', marginLeft: 30 }}>
          <PlusOutlined style={{ marginLeft: 10 }} onClick={e => onCreate(item.id)} />
        <EditOutlined style={{ marginLeft: 10 }} onClick={e => onUpdate(item)} />
            <CloseOutlined style={{ marginLeft: 10 }} onClick={e => onDelete(item)} />
        </span>
    </div>;
  }
}

export default ResourceItem;
